package ace.module.oauth2.server.sdk.core.callback.feign;

import ace.module.oauth2.server.api.callback.Oauth2AceAuthorizationCallbackApi;
import ace.module.oauth2.server.api.callback.model.input.Oauth2AceAuthorizationCallbackInput;
import ace.module.oauth2.server.api.model.dto.ext.Oauth2AceUserInfoResultDto;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * rest方式的获取账户资料回调协议.
 *
 * @author caspar
 */
public interface Oauth2AceAuthorizationCallbackFeign extends Oauth2AceAuthorizationCallbackApi {

  @Operation(summary = "从第三方获取对应账户授权资料")
  @PostMapping("/getUserInfo")
  Oauth2AceUserInfoResultDto getUserInfo(@Valid @NotNull @RequestBody Oauth2AceAuthorizationCallbackInput request);
}
